package com.yuju.order.service.impl;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yuju.common.core.dao.IBaseDao;
import com.yuju.common.core.service.AbstractBaseService;
import com.yuju.order.dao.IRoomOrderChangeAccountDao;
import com.yuju.order.dao.entity.RoomOrderChangeAccount;
import com.yuju.order.model.RoomOrderChangeAccountModel;
import com.yuju.order.service.IRoomOrderChangeAccountService;
import com.yuju.util.Utils;

/**
 * 
 * 类名：RoomOrderChangeAccountServiceImpl  <br />
 *
 * 功能：
 *
 * @author : zhousc <br />
 * @Date : 2018年1月3日 上午10:43:06  <br />
 * @version : 1.1 <br />
 */
@Service
public class RoomOrderChangeAccountServiceImpl extends AbstractBaseService<RoomOrderChangeAccountModel, RoomOrderChangeAccount, String> implements IRoomOrderChangeAccountService{

	@Autowired
	private IRoomOrderChangeAccountDao roomOrderChangeAccountDao;
	
	@Override
	public IBaseDao<RoomOrderChangeAccountModel, RoomOrderChangeAccount, String> getDao() {
		// TODO Auto-generated method stub
		return roomOrderChangeAccountDao;
	}

	/**
	 * 
	 * 功能: <br/>
	 * 
	 * 重写：zhousc <br/>
	 * 
	 * @Date ：2018年1月3日 上午10:43:15<br/>
	 * 
	 * @param roomOrderChangeAccountModel
	 * @return <br/>
	 * @see com.yuju.common.core.service.AbstractBaseService#save(java.lang.Object)
	 */
	@Override
	public int save(RoomOrderChangeAccountModel roomOrderChangeAccountModel){
		roomOrderChangeAccountModel.setId(Utils.getUUID());
		roomOrderChangeAccountModel.setGmtCreate(new Date());
		roomOrderChangeAccountModel.setGmtModified(new Date());
		return this.getDao().saveSelective(roomOrderChangeAccountModel);
	}
	
	/**
	 * 
	 * 功能: <br/>
	 * 
	 * 重写：zhousc <br/>
	 * 
	 * @Date ：2018年1月3日 上午10:43:20<br/>
	 * 
	 * @param roomOrderChangeAccountModel
	 * @return <br/>
	 * @see com.yuju.common.core.service.AbstractBaseService#updateSelective(java.lang.Object)
	 */
	@Override
	public int updateSelective(RoomOrderChangeAccountModel roomOrderChangeAccountModel){
		roomOrderChangeAccountModel.setGmtModified(new Date());
		return this.getDao().updateSelective(roomOrderChangeAccountModel);
	}
}